<template>
  <div class="ad-form">
    <el-form size="mini" inline label-position="right" label-width="auto" ref="form" :model="form" >
      <div class="ad-block">
        <el-form-item label="签章："prop="contractSignImg" :rules="[{required: true, message: '请上传'}]">
          <ad-upload v-model="form.contractSignImg"/>
        </el-form-item>
      </div>
    </el-form>
    <div class="op">
      <el-button type="primary"  @click="save">保 存</el-button>
      <el-button type="primary" plain @click="cancel">取 消</el-button>
    </div>
  </div>
</template>

<script>
import AdInputNumber from '@/components/AdInputNumber'
import AdCitySelect from '@/components/AdCitySelect'
import AdCityMultiSelect from '@/components/AdCityMultiSelect'
import adForm from '@/mixins/adForm'
import { getContractSigning,getContractSignings } from '@/api/city/provinceCity'
import { add, edit, get } from '@/api/site'
import AdUpload from '@/components/AdUpload/index.vue'

class Form {

}

export default {
  components: { AdUpload, AdInputNumber, AdCitySelect, AdCityMultiSelect },
  // mixins: [adForm({get, add, edit})],
  data() {
    return {
      cityData: [],
      form:{
        contractSignImg:''
      }
    }
  },
  created() {
    getContractSigning().then(res => this.form.contractSignImg = res.data)
  },
  methods: {
    save () {
       this.$refs.form.validate(valid => {
        if (valid) {
          getContractSignings({
            contractSignImg:this.form.contractSignImg
          }).then(res => {
            if (res.code == 200) {
              this.$message.success('保存成功')
            }
            this.$emit('signaturManagementSaved')
          })

        }
      })
    },
    cancel () {
      this.$emit('signaturManagementCancel')
    }
  }
}
</script>

<style scoped>

</style>